package com.hz.nutiparams.os.controller;

import com.hz.nutiparams.os.bean.UserBean;
import com.hz.nutiparams.os.bean.UserSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.su.generalmvc.IModel;
import org.su.generalmvc.annotaion.*;

import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
*
* Created by 杨川 on 2016-08-09 10:04:26.
*/
@Controller(url = "/")
public class LoginController {


    @RequestMapping(value = ViewType.json, permiss = Permiss.no)
    public void dologin(IModel model, @Param("user")UserBean[] user,
                        @Param("name")String[] names,
                        @Param("phone")List<String> phone){
        System.out.println(user);
        model.addData("user",user);
        model.addData("names",names);
        model.addData("phone",phone);
    }

    @RequestMapping(permiss = Permiss.no)
    public void login(){

    }

    @RequestMapping(value = ViewType.json, permiss = Permiss.no)
    public void dologin2(IModel model,
                         @Param(value="user",type = ContentType.json)List<UserBean> user,
                         @Param("name") Set<String> names){
        System.out.println(user);
        model.addData("user",user);
        model.addData("names",names);
    }

    @RequestMapping(permiss = Permiss.no)
    public void login2(){

    }
}
